#include <iostream>
using namespace std;

#define UPPER_LIMIT 4000000

int main()
{
    long int a=1,b=2,sum=2;
    while((a+b) <= UPPER_LIMIT)
    {
        b=b+a;
        a=b-a;
        if(b%2==0) sum=sum+b;
    }
    cout<<"sum is "<<sum<<endl;
    return 0;
}